package org.huawei260.String;

import java.util.Scanner;

/**
 * @Auther: qingle
 * @Date: 2024/10/25-19:10
 * @Description:
 * 交换字符
 * 题目描述
 * 给定一个字符串S
 * 变化规则:
 * 交换字符串中任意两个不同位置的字符M
 * S都是小写字符组成
 * 1 <= S.length <= 1000
 *
 * 输入描述
 * 一串小写字母组成的字符串
 *
 * 输出描述
 * 按照要求变换得到最小字符串
 *
 * 示例一
 * 输入
 * abcdef
 * 输出
 * abcdef
 *
 * @version: 1.0
 */
public class O0066_交换字符 {
	
	public static void main(String[] args)
	{
//		String line = "abcdef";
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int random1 = (int)(Math.random()*line.length());
		int random2 = (int)(Math.random()*line.length());

		System.out.println("随机位置1:" + random1);
		System.out.println("随机位置2:" + random2);
		System.out.println(changeString(line,random1,random2));
	}

	private static String changeString(String line, int random1, int random2) {
		char[] chars = line.toCharArray();
		char temp = chars[random1];
		chars[random1] = chars[random2];
		chars[random2] = temp;
		return String.valueOf(chars);

	}
}
